-
-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add route/list command #96
Conversation
rustamwin
commented
May 7, 2020
Q | A |
---|---|
Is bugfix? | ❌ |
New feature? | ❌ |
Breaks BC? | ❌ |
Tests pass? | - |
Fixed issues | - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is great.
It would be nice if we could, in general, switch between (console)-table output and eg. json, but that can be done later.
src/Command/Route/ListCommand.php
Outdated
$table = new Table($output); | ||
$io = new SymfonyStyle($input, $output); | ||
/** @var Route[] $routes */ | ||
$routes = $this->urlMatcher->getRouteCollection()->getRoutes(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it will be better to use RouteCollection()->getRouteTree(false) to get routes tree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yiiliveext or we need to drop getRouteTree
method from RouteCollection
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yiiliveext or we need to drop
getRouteTree
method fromRouteCollection
instead?
Routes tree is more informative and convenient. It is used by the debugger.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it will be better to use RouteCollection()->getRouteTree(false) to get routes tree
This is a route table, not a tree.
src/Command/Route/ListCommand.php
Outdated
$table = new Table($output); | ||
$io = new SymfonyStyle($input, $output); | ||
/** @var Route[] $routes */ | ||
$routes = $this->urlMatcher->getRouteCollection()->getRoutes(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yiiliveext or we need to drop getRouteTree
method from RouteCollection
instead?
…te-command # Conflicts: # config/common.php
Good one. Thanks! |